package com.sugar.persistence.oa.hr.impl;

import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.stereotype.Controller;

import com.sugar.common.base.persistence.IHibernateBaseDaoSupport;
import com.sugar.common.base.persistence.query.PageModel;
import com.sugar.domain.oa.hr.Department;
import com.sugar.persistence.oa.hr.IDepartment;

@Controller
public class DepartmentDaoImpl extends IHibernateBaseDaoSupport<Department> implements IDepartment {
	
	@Override
	public void deleteDeptDao(Department dept) {
		this.deleteEntityBaseDao(dept) ;
	}

	@Override
	public List<Department> findDeptDao(String queryString, String whereStr,
			Object[] param, LinkedHashMap<String, String> orderby)
			throws RuntimeException {
	
		return this.findMoreEntityByParam(queryString, whereStr, param, orderby) ;
	}

	@Override
	public PageModel<Department> getScorllDeptDao(String queryString,
			String whereStr, Object[] param, int firstPage, int pageSize,
			LinkedHashMap<String, String> orderby) {
	
		return this.getScrollRecord(queryString, whereStr, param, firstPage, pageSize, orderby);
	}

	@Override
	public Department loadDeptByIdDao(String id) {
	
		return this.loadEntityById(Department.class, id) ;
	}

	@Override
	public void saveDeptDao(Department dept) {
		this.saveEntityBaseDao(dept) ;
	}

	@Override
	public void updateDeptDao(Department dept) {
		this.updateEntityBaseDao(dept) ;
	}

	@Override
	public void deleteSelectDeptDao(Object[] ids) {
		this.deleteEntityMoreIdBaseDao(Department.class, ids) ;
	}

}
